Repository navigation
fix(bin): decode proxy response streams with StringDecoder (#4336) - #4341
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 25 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #4336 — the response-side twin of #3186.
Problem
Across
bin/, subprocess stdout line buffers and upstream response accumulators decoded each chunk separately (buffer += chunk.toString('utf-8')), so a multibyte UTF-8 sequence split across chunks became U+FFFD inside JSON string values and was silently forwarded to clients. Verified on main f854b4d: all nine primary sites present, zeroStringDecoderinbin/.Change
bin/stream-decode.mjs(createStreamDecoder(), wrappingnode:string_decoder) — the streaming counterpart ofbin/request-body.mjs._onStdout, claude-code-proxy_onStdout, codex-proxy, commandcode-proxy (both handlers), muse-proxy (warm + cold handlers).parseAgyModelsOutputinput), muse-proxy--flagscan accumulator.Tests
bin/stream-decode.test.mjs: split at every byte offset of a JSON line containing 3-byte and 4-byte sequences, one-byte-at-a-time feeding, and a JSON-parse check after a split inside the 3-byte sequence.Enqueued by triage task 6208; worked as queue task 6213.
Need help on this PR? Tag
@codesmith-botwith what you need.